# #################################
# 公共组件的界面适配+集成插件
# #################################

# 设置前缀以避免重名
set(GDMPComponentsPrefix "Sample_")

# 设置在IDE(VS)中的文件夹
set(GDMPComponentsSampleFolder "公共组件示例")

# 设置插件addin需要放置bin路径下的相对目录（支持多个）
set(GDMPComponentsAddinFolders
    "gbmp_plugin_config"
)

# 指定公共组件SDK路径
# set(GDMPComponentsSDK_DIR "${CMAKE_SOURCE_DIR}/../../../../GCMP_SDK" CACHE PATH "GDMPComponents sdk root path")

if(EXISTS "${GDMPComponentsSDK_DIR}")
    list(APPEND CMAKE_PREFIX_PATH ${GDMPComponentsSDK_DIR})
    find_package(Gdmp COMPONENTS foundation.ui foundation REQUIRED)
    add_subdirectory(UiAdapter)
    add_subdirectory(Plugins)

    foreach( OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES} ) 
        string( TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG ) 
        set_target_properties("${GDMPComponentsPrefix}UiAdapter" PROPERTIES   RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG}  ${PROJECT_BINARY_DIR}/../$(Platform)$(Configuration) ) 
        set_target_properties("${GDMPComponentsPrefix}UiAdapter" PROPERTIES   LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG}  ${PROJECT_BINARY_DIR}/../$(Platform)$(Configuration) ) 
        set_target_properties("${GDMPComponentsPrefix}UiAdapter" PROPERTIES   ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG}  ${PROJECT_BINARY_DIR}/../$(Platform)$(Configuration) ) 
        
        set_target_properties("${GDMPComponentsPrefix}Plugin" PROPERTIES   RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG}  ${PROJECT_BINARY_DIR}/../$(Platform)$(Configuration) ) 
        set_target_properties("${GDMPComponentsPrefix}Plugin" PROPERTIES   LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG}  ${PROJECT_BINARY_DIR}/../$(Platform)$(Configuration) ) 
        set_target_properties("${GDMPComponentsPrefix}Plugin" PROPERTIES   ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG}  ${PROJECT_BINARY_DIR}/../$(Platform)$(Configuration) )         
    endforeach()
endif()

